﻿using System;
using System.Reflection;
using MugenInjection.Delegates;

namespace MugenInjection.Interception.Interface
{
    /// <summary>
    /// Represent a proxy metadata.
    /// </summary>
    public interface IProxy
    {
        /// <summary>
        /// Gets the metadataToken of the proxy method.
        /// </summary>
        int MetadataToken { get; }

        /// <summary>
        /// Gets the member of the proxy. 
        /// </summary>
        MemberInfo Member { get; }

        /// <summary>
        /// Gets the proxy instance.
        /// </summary>
        object Instance { get; }

        /// <summary>
        /// Gest the original action, if any.
        /// </summary>
        Action OriginalAction { get; }

        /// <summary>
        /// Gets or sets a method for the interception.
        /// </summary>
        Action OnInvoke { get; set; }

        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        IProxy Clone();
    }
}